package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.Storage;
import com.weipai.springboot.module.dao.StorageDao;
import com.weipai.springboot.module.mapper.StorageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/09/15 10:03
 */
@Repository
public class StorageDaoImpl implements StorageDao {
    
    @Autowired
    private StorageMapper storageMapper;
    
    @Override
    public int insertSelective(Storage storage) {
        return storageMapper.insertSelective(storage);
    }

    @Override
    public Storage getStorageById(String storageId) {
        return storageMapper.getStorageById(storageId);
    }

    @Override
    public List<Storage> selectAllByStorageDel(int del, String search, String sort, String way) {
        return storageMapper.selectAllByStorageDel(del, search, sort, way);
    }

    @Override
    public int batchDeleteById(String[] id) {
        return storageMapper.batchDeleteById(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Storage storage) {
        return storageMapper.updateByPrimaryKeySelective(storage);
    }

    @Override
    public int updateByPrimaryKey(Storage storage) {
        return storageMapper.updateByPrimaryKey(storage);
    }

    @Override
    public int updateStatus(String storageId, Integer status) {
        return storageMapper.updateStatus(storageId, status);
    }

    @Override
    public List<Map<String, Object>> listNoGoods(String storageId, Integer start, Integer size) {
        return storageMapper.listNoGoods(storageId, start, size);
    }

    @Override
    public Integer countNoGoods(String storageId) {
        return storageMapper.countNoGoods(storageId);
    }

    
    @Override
    public Map<String, Object> locateStorage(String longitude, String latitude) {
        return storageMapper.locateStorage(longitude, latitude);
    }

    @Override
    public List<Map<String, Object>> getStorage() {
        return storageMapper.getStorage();
    }
}
